package com.sanhe.rfmuscle.activity;

import static com.menu.app.util.FunctionCode.START1;
import static com.menu.app.util.FunctionCode.START2;

import android.content.Intent;

import com.menu.app.activity.BaseSettingMenuActivity;
import com.menu.app.bean.BoardItem;
import com.menu.app.util.port.SerialManage;
import com.sanhe.rfmuscle.activity.work.InfoActivity;

import java.util.List;

public class SettingMenuActivity extends BaseSettingMenuActivity {


    @Override
    protected List getSettings() {
        List list = super.getSettings();
        list.remove(4);
        list.add(2, new BoardItem(getString(com.menu.app.R.string.machine), () -> {
            toInfo();
        }));
        return list;
    }

    private void toInfo() {
        Intent i = new Intent(this, InfoActivity.class);
        startActivity(i);
    }

    @Override
    protected void sendTouchEvent(byte data_H, byte data_L) {
        byte[] tmp = {START1, START2, 6, -125, 16, 1, 1, 0, data_L};
        SerialManage.getInstance().send(tmp);
    }
}
